# Maintainer: Antonio Rojas <arojas@archlinux.org>

pkgname=libcerf
epoch=1
pkgver=2.3
pkgrel=2
pkgdesc='Self-contained numeric library that provides an efficient and accurate implementation of complex error functions'
arch=(x86_64)
url='https://jugit.fz-juelich.de/mlz/libcerf/'
license=(custom)
depends=(glibc)
makedepends=(cmake)
source=(https://jugit.fz-juelich.de/mlz/libcerf/-/archive/v$pkgver/libcerf-v$pkgver.tar.gz)
sha256sums=('cceefee46e84ce88d075103390b4f9d04c34e4bc3b96d733292c36836d4f7065')

build() {
  cmake -B build -S $pkgname-v$pkgver \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DPORTABLE=ON
  cmake --build build
}

package() {
  DESTDIR="$pkgdir" cmake --install build

  install -Dm644 $pkgname-v$pkgver/LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname
}
